package com.lie.prepare.multi_thread.even_checker;

/**
 * Created by lie on 2018/4/9.
 */
public class SynchronizedEvenGenerator extends IntGenerator {

    private int currentIntValue = 0;

    public synchronized int next() {
        ++currentIntValue;
        Thread.yield();
        ++currentIntValue;
        return currentIntValue;
    }
}
